<script type="text/javascript">
    function switchProTab(type){

        var last_tap = document.getElementById('current_tap').value;
//        document.getElementById('tab_'+type).className='';


        if(last_tap!=type){
            document.getElementById('current_tap').value = type;
            document.getElementById('tab_'+last_tap).className = '';
            document.getElementById("pro_content_"+last_tap).style.display = "none";
            document.getElementById("tab_"+type).className = "curent";
            document.getElementById("pro_content_"+type).style.display = "block";
        }
        //alert(document.getElementById("tab_"+type).className);

    }
</script>

        <?php foreach($this->detailPro as $key=>$value):?>
        <div class="Main_Header">
            <span >Chi tiết sản phẩm: <?=$value->pname?></span>
        </div>
        <div class="hinhanh-chitiet" align="center">
            <span >Sản phẩm: <?php echo $value->pname?></span>
            <div>
                <img src="<?php echo PATH?>/media/images/products/<?php echo $value->picture?>" alt="<?php echo $value->pname?>" />
            </div>

           </div>
            <div id="prod_detail">
                <div>
                    <b>Giá bán: </b><?=number_format($value->price,0,',','.')?> VND
                </div>
                <div>
                    <b>Chức năng: </b>
                <?foreach($this->listmenuproduct as $menu=>$list)
                if($list->pfid==$value->pfid) echo $list->pfname
                ?>
                </div>
                <div>
                    <b>Hãng xe: </b><?
                    foreach($this->listmanufacture as $menu=>$list)
                    if($list->mfid==$value->mfid) echo $list->mfname
                    ?>
                </div>
                <div>
                    <b>Nhà cung cấp: </b><?=$value->distributor?>
                </div>
                <div>
                    <b>Mã sản phẩm: </b>SP0<?=$value->pid?>
                </div>
                <div>
                    <b>Bảo hành: </b><?=$value->warranty?>
                </div>
                <div class="block_but" align="center">
                    <input type="button" name="order" value="Cho vào giỏ" onclick="location='<?=PATH?>/shoppingcart/add/<?=$value->pid?>'">
                    <input type="button" name="buy" value="Tiếp tục mua hàng" onclick="location='<?=PATH?>'">
                </div>


            </div>
            <div id="prod_mota" align="center">
                <div id="tabMenuDm">
                    <div>
                        <ul>

                            <li id="tab_desc" class="curent" onclick="switchProTab('desc')">
                                Miêu tả sản phẩm&nbsp</li>

                            <li id="tab_review" onclick="switchProTab('review')">
                                Ý kiến khách hàng&nbsp</li>


                        </ul>
                    </div>
                </div>
                <div>
                    <input type="hidden" id="current_tap" value="desc" />
                    <div id="pro_content_desc" style="display: block;">
                        <?=$value->detail?>
                    </div>
                    <div id="pro_content_review" style="display: none;">
                        Bình luận
                    </div>
                </div>


        </div>


        <?php endforeach;?>


        <div class="Main_Header">

            <span> Sản phẩm cùng loại khác</span>
        </div>
            <?for($i=1;$i<7;$i++){?>
            <div class="box_product"></div>
            <?}?>


